/**
 * <p>Copyright:Copyright(c) 2019</p>
 * <p>Company:Professional</p>
 * <p>Package:com.cesgroup.zw.spring.boot.echarts.model.effect</p>
 * <p>File:LineEffect.java</p>
 * <p>类更新历史信息</p>
 * @todo chanlong(陈龙) 创建于 Jun 4, 2019 12:18:16 PM
 */
package com.cesgroup.zw.spring.boot.echarts.model.effect;

import java.io.Serializable;
import java.math.BigDecimal;

import com.cesgroup.zw.spring.boot.supports.jackson.JavaScriptSerializer;
import com.cesgroup.zw.spring.boot.supports.util.math.BigDecimalUtil;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;

import lombok.Data;

/**
 * <p>描述: 线特效</p>
 * <p>Company: Professional</p>
 * @author chanlong(陈龙)
 * @date Jun 4, 2019 12:18:16 PM
 * @version 1.0.2019
 */
@Data @SuppressWarnings("serial")
public class LineEffect implements Serializable {

	/** 是否显示特效，[default: false] */
	private Boolean show;
	
	/** 特效动画的时间，单位秒，[default: 4] */
	private Integer period;
	
	/** 特效动画的延时，支持设置成数字或者回调。单位ms */
	@JsonSerialize(using = JavaScriptSerializer.class)
	private Object delay;
	
	/** 配置特效图形的移动动画是否是固定速度，单位像素/秒，设置为大于 0 的值后会忽略 period 配置项 */
	private BigDecimal constantSpeed;
	
	/** 特效标记的图形，[default: 'circle'] */
	private Object symbol;
	
	/** 特效标记的大小，[default: 3] */
	private Object symbolSize;
	
	/** 特效标记的颜色 */
	private Object color;
	
	/** 特效尾迹的长度。取从 0 到 1 的值，数值越大尾迹越长，[default: 0.2] */
	private BigDecimal trailLength;
	
	/** 是否循环显示特效，[default: true] */
	private Boolean loop;
	
	public void setConstantSpeed(int speed) {
		this.constantSpeed = BigDecimalUtil.valueOf(speed);
	}
	
	public void setConstantSpeed(double speed) {
		this.constantSpeed = BigDecimalUtil.valueOf(speed);
	}
	
	public void setTrailLength(int length) {
		this.trailLength = BigDecimalUtil.valueOf(length);
	}
	
	public void setTrailLength(double length) {
		this.trailLength = BigDecimalUtil.valueOf(length);
	}
}
